<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="./css/swiper-bundle.min.css">
    <style>
        * {
            margin: 0px;
        }

        .swiper {

            height: 680px;
        }

        .bg1 {
            background: url(./images/banner1.png) no-repeat center top;
        }

        .bg2 {
            background: url(./images/banner2.png) no-repeat center 0;
        }

        .bg3 {
            background: url(./images/banner3.png) no-repeat center 0;
        }
    </style>
</head>

<body>

    <div class="swiper">
        <div class="swiper-wrapper">
            <div class="swiper-slide bg1">
            </div>
            <div class="swiper-slide bg2">
            </div>
            <div class="swiper-slide bg3">
            </div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>

        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>

        <!-- 如果需要滚动条 -->
        <!-- <div class="swiper-scrollbar"></div> -->
    </div>
    导航等组件可以放在Swiper容器之外

    <script src="./lib/swiper-bundle.min.js"></script>

    <script>        
        var mySwiper = new Swiper('.swiper',
            {
                // direction: 'vertical', // 垂直切换选项
                loop: true, // 循环模式选项

                autoplay: {
                    delay: 1500,  //停留时间
                    stopOnLastSlide: false,  //显示完最后一张之后继续播放。
                    disableOnInteraction: false, //用户操作时停止自动播放。 
                    pauseOnMouseEnter: true  //鼠标移入时就停止怎么播放，离开时又开启自动播放。
                },
                // keyboard : true,
                
                // 如果需要分页器
                pagination: {
                    el: '.swiper-pagination',
                },

                // 如果需要前进后退按钮
                navigation: {
                    nextEl: '.swiper-button-next',
                    prevEl: '.swiper-button-prev',
                },

                // 如果需要滚动条
                // scrollbar: {
                //     el: '.swiper-scrollbar',
                // },
            }
        )        
    </script>
</body>

</html>